package com.mls.education.service.impl;

import java.util.Date;
import java.util.List;

import com.mls.education.domain.EduComment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mls.education.mapper.EduCommentMapper;
import com.mls.education.service.IEduCommentService;
import com.mls.common.core.text.Convert;

/**
 * 评论管理Service业务层处理
 * 
 * @author admin
 * @date 2022-03-10
 */
@Service
public class EduCommentServiceImpl implements IEduCommentService
{
    @Autowired
    private EduCommentMapper eduCommentMapper;

    /**
     * 查询评论管理
     * 
     * @param id 评论管理主键
     * @return 评论管理
     */
    @Override
    public EduComment selectEduCommentById(Integer id)
    {
        return eduCommentMapper.selectEduCommentById(id);
    }

    /**
     * 查询评论管理列表
     * 
     * @param eduComment 评论管理
     * @return 评论管理
     */
    @Override
    public List<EduComment> selectEduCommentList(EduComment eduComment)
    {
        return eduCommentMapper.selectEduCommentList(eduComment);
    }

    /**
     * 新增评论管理
     * 
     * @param eduContent 评论管理
     * @return 结果
     */
    @Override
    public int insertEduComment(EduComment eduContent)
    {
        eduContent.setReplyTime(new Date());
        return eduCommentMapper.insertEduComment(eduContent);
    }

    /**
     * 修改评论管理
     * 
     * @param eduComment 评论管理
     * @return 结果
     */
    @Override
    public int updateEduComment(EduComment eduComment)
    {
        return eduCommentMapper.updateEduComment(eduComment);
    }

    /**
     * 批量删除评论管理
     * 
     * @param ids 需要删除的评论管理主键
     * @return 结果
     */
    @Override
    public int deleteEduCommentByIds(String ids)
    {
        return eduCommentMapper.deleteEduCommentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除评论管理信息
     * 
     * @param id 评论管理主键
     * @return 结果
     */
    @Override
    public int deleteEduCommentById(Integer id)
    {
        return eduCommentMapper.deleteEduCommentById(id);
    }
}
